1. Field of the Invention
The present invention relates to image processing apparatuses and methods, recording media, and programs. More specifically, the present invention relates to an image processing apparatus and method, recording medium, and program that can be used suitably when a dynamic range of an image is converted to a narrower dynamic range.
2. Description of the Related Art
Recently, with the improvement in the performance of image sensors, the dynamic range of images that can be captured by a video camera is increasing. However, in some cases, a dynamic range of display possible with a display device is narrower than the dynamic range of an image captured by a video camera that is capable of capturing images with a large dynamic range. In view of this situation, tone compression techniques for reducing the dynamic range of an image while avoiding substantial reduction in the contrast of the image have been proposed, for example, as disclosed in Japanese Unexamined Patent Application Publication No. 2004-221644 and Japanese Unexamined Patent Application Publication No. 2004-221645.
FIG. 1 is a block diagram showing an example of the functional configuration of a digital signal processor (DSP) that tone-compresses pixel values of an image, described in Japanese Unexamined Patent Application Publication No. 2004-221645.
A logarithmic converter 11 logarithmically converts luminance values L(p) of an input image, and outputs resulting logarithmic luminance values logL(p) to a tone-curve corrector 12. The tone-curve corrector 12 tone-compresses the logarithmic luminance values logL(p) according to a predefined tone curve, and outputs resulting logarithmic luminance values logLc(p) to a reduced-image generator 13 and a contrast corrector 15. Also, the tone-curve corrector 12 outputs a representative value γ representing the slope of the tone curve used to the contrast corrector 15.
The reduced-image generator 13 generates a reduced image logLc1 on the basis of the logarithmic luminance values logLc(p) of one frame, input from the tone-curve corrector 12, and stores the reduced image logLc1 in a reduced-image memory 14.
The contrast corrector 15 corrects the contrast, which has been reduced through the tone-curve-based correction of the logarithmic luminance values logLc(p) of a current frame input from the tone-curve corrector 12, on the basis of the representative value γ and a reduced image logLc1 of an immediately preceding frame, stored in the reduced-image memory 14. The contrast corrector 15 then outputs resulting logarithmic luminance values logLu(p) to an inverse logarithmic converter 16. The inverse logarithmic converter 16 executes inverse logarithmic conversion of the contrast-corrected logarithmic luminance values logLu(p), and outputs resulting luminance values Lu(p) on a linear axis to a gamma corrector 17.
The gamma corrector 17 executes gamma correction on the luminance values Lu(p) input from the inverse logarithmic converter 16, in consideration of gamma characteristics of a display device used, and outputs gamma-corrected luminance values Y(p) to a luminance-information calculator 18 and a luminance-range normalizer 20. The luminance-information calculator 18 calculates luminance-range information [Yd, Yb] representing a highest luminance value Yd and a lowest luminance value Yb of the luminance values Y(p) of one frame input from the gamma corrector 17, and stores the luminance-range information [Yd, Yb] in a luminance-range-information memory 19.
The luminance-range normalizer 20 converts the luminance values Y(p) of the current frame, input from the gamma corrector 17, on the basis of luminance-range information [Yd, Yb] of the immediately preceding frame, stored in the luminance-range-information memory 19, so that the range of distribution thereof matches a range that can be displayed by the display device. The luminance-range normalizer 20 then outputs resulting luminance values Yn(p) to a subsequent stage as pixel values of reduced-dynamic-range image.